require 'nvim-treesitter.install'.compilers = {"gcc"}
require 'nvim-treesitter.configs'.setup {
    -- ensure_installed = {"cpp", "python", "lua", "vim", "vimdoc"},
    sync_install = false,
    auto_install = false,
    -- ignore_install = { "javascript" },
    highlight = {
        enable = true,
        disable = {"c"},
        disable = function(lang, buf)
            local max_filesize = 10 * 1024 * 1024 -- 10 MB
            local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
            if ok and stats and stats.size > max_filesize then
                return true
            end
        end,
        additional_vim_regex_highlighting = false,
    },
    incremental_selection = {
        enable = true,
        keymaps = {
            init_selection = '<cr>',
            node_incremental = '<cr>',
            node_decremental = '<bs>',
            scope_incremental = '<tab>',
        }
    },
    indent = {
        enable = true
    },
    rainbow = {
        enable = true,
        extended_mode = true,
        max_file_lines = nil,
    }
}
